using System.Linq.Expressions;
using Lily.TestHelper.UI;

namespace Lily.TestHelper
{
	public class TextInputTester : InputTesterBase<string>
	{
		public TextInputTester(LambdaExpression property, string value)
			: base(value, ReflectionHelper.BuildNameFrom(property)) { }

		public override void AssertInputValueMatches(IWindowDriver browserDriver)
		{
			string actualValue = browserDriver.GetValue(_inputName);

			_value.ShouldEqual(actualValue, "Asserting value for input '" + _inputName + "'.");
		}

		public override void SetInput(IWindowDriver browserDriver)
		{
			browserDriver.SetValue(_inputName, _value);
		}
	}
}